<!DOCTYPE html>
<!-- saved from url=(0041)http://c.biancheng.net/view/vip_7079.html -->
<html lang="zh-CN"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><script type="text/javascript" async="" charset="utf-8" src="./11.16Java 9中增强的“菱形”语法_files/core.php"></script>

<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
<!-- 启用Chromium高速渲染模式 -->
<meta name="renderer" content="webkit">
<meta name="force-rendering" content="webkit">
<!-- 禁止百度转码 -->
<meta name="applicable-device" content="pc,mobile">
<meta name="MobileOptimized" content="width">
<meta name="HandheldFriendly" content="true">
<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Cache-Control" content="no-siteapp">
<!-- 禁止识别电话号码 -->
<meta name="format-detection" content="telephone=no">

<link rel="shortcut icon" href="http://c.biancheng.net/favicon.ico?v=1.6.72">
<link href="./11.16Java 9中增强的“菱形”语法_files/common.css" rel="stylesheet">
<title>Java 9中增强的“菱形”语法</title>
<meta name="description" content="在 Java 7 版本以前，如果使用带泛型的接口、类定义变量，那么调用构造器创建对象时构造器的后面也必须带泛型，这显得有些多余了。例如如下两条语句： ListString strList = new ArrayList">
</head>
<body>
<div id="topbar" class="clearfix">
	<ul id="product-type" class="left">
		<li>
			<a href="http://c.biancheng.net/"><span class="iconfont iconfont-home"></span>首页</a>
		</li>
		<li class="active">
			<a href="http://c.biancheng.net/sitemap/" rel="nofollow"><span class="iconfont iconfont-book"></span>教程</a>
		</li>
		<li>
			<a href="http://vip.biancheng.net/p/vip/show.php" rel="nofollow" target="_blank"><span class="iconfont iconfont-vip"></span>VIP会员</a>
		</li>
		<li>
			<a href="http://vip.biancheng.net/p/q2a/show.php" rel="nofollow" target="_blank"><span class="iconfont iconfont-q2a"></span>一对一答疑</a>
		</li>
		<li>
			<a href="http://fudao.biancheng.net/" rel="nofollow" target="_blank"><span class="iconfont iconfont-fudao"></span>辅导班</a>
		</li>
	</ul>
</div>
<div id="header" class="clearfix">
	<a id="logo" class="left" href="http://c.biancheng.net/">
		<img height="26" src="./11.16Java 9中增强的“菱形”语法_files/logo.png" alt="C语言中文网">
	</a>
	<ul id="nav-main" class="hover-none left clearfix">
		<li class="wap-yes"><a href="http://c.biancheng.net/">首页</a></li>
		<li><a href="http://c.biancheng.net/c/">C语言教程</a></li>
		<li><a href="http://c.biancheng.net/cplus/">C++教程</a></li>
		<li><a href="http://c.biancheng.net/python/">Python教程</a></li>
		<li><a href="http://c.biancheng.net/java/">Java教程</a></li>
		<li><a href="http://c.biancheng.net/linux_tutorial/">Linux入门</a></li>
		<li><a href="http://c.biancheng.net/sitemap/" title="网站地图">更多&gt;&gt;</a></li>
	</ul>
	<span id="sidebar-toggle" class="toggle-btn" toggle-target="#sidebar">目录 <span class="glyphicon"></span></span>

	<a href="http://vip.biancheng.net/?from=topbar" class="user-info glyphicon glyphicon-user hover-none" target="_blank" rel="nofollow" title="用户中心"></a>
</div>
<div id="main" class="clearfix">
	<div id="sidebar" class="toggle-target">
	<div id="contents">
		<dt><span class="glyphicon glyphicon-option-vertical" aria-hidden="true"></span><a href="http://c.biancheng.net/java/">Java教程</a></dt>
		
			<dd>
				<span class="channel-num">1</span>
				<a href="http://c.biancheng.net/java/10/">Java入门基础及环境搭建</a>
			</dd>
		
			<dd>
				<span class="channel-num">2</span>
				<a href="http://c.biancheng.net/java/20/">Java程序设计基础</a>
			</dd>
		
			<dd>
				<span class="channel-num">3</span>
				<a href="http://c.biancheng.net/java/30/">Java流程控制语句</a>
			</dd>
		
			<dd>
				<span class="channel-num">4</span>
				<a href="http://c.biancheng.net/java/40/">Java字符串处理</a>
			</dd>
		
			<dd>
				<span class="channel-num">5</span>
				<a href="http://c.biancheng.net/java/50/">Java数字和日期处理</a>
			</dd>
		
			<dd>
				<span class="channel-num">6</span>
				<a href="http://c.biancheng.net/java/60/">Java内置包装类</a>
			</dd>
		
			<dd>
				<span class="channel-num">7</span>
				<a href="http://c.biancheng.net/java/70/">Java数组处理</a>
			</dd>
		
			<dd>
				<span class="channel-num">8</span>
				<a href="http://c.biancheng.net/java/80/">Java类和对象</a>
			</dd>
		
			<dd>
				<span class="channel-num">9</span>
				<a href="http://c.biancheng.net/java/90/">Java继承和多态</a>
			</dd>
		
			<dd>
				<span class="channel-num">10</span>
				<a href="http://c.biancheng.net/java/100/">Java异常处理</a>
			</dd>
		<dd class="this"> <span class="channel-num">11</span> <a href="http://c.biancheng.net/java/110/">Java集合、泛型和枚举</a> </dd><dl class="dl-sub"><dd>11.1 <a href="http://c.biancheng.net/view/6824.html">Java集合</a></dd><dd>11.2 <a href="http://c.biancheng.net/view/6782.html">Java Collection接口</a></dd><dd>11.3 <a href="http://c.biancheng.net/view/6843.html">Java List集合</a></dd><dd>11.4 <a href="http://c.biancheng.net/view/6847.html">Java Set集合</a></dd><dd>11.5 <a href="http://c.biancheng.net/view/6868.html">Java Map集合</a></dd><dd>11.6 <a href="http://c.biancheng.net/view/6872.html">Java遍历Map集合</a></dd><dd>11.7 <a href="http://c.biancheng.net/view/vip_7078.html">Java 8中Map新增的方法</a><span class="glyphicon glyphicon-usd"></span></dd><dd>11.8 <a href="http://c.biancheng.net/view/6884.html">Java Collections类</a></dd><dd>11.9 <a href="http://c.biancheng.net/view/6793.html">Lambda表达式遍历Collection集合</a></dd><dd>11.10 <a href="http://c.biancheng.net/view/6795.html">使用迭代器遍历集合元素</a></dd><dd>11.11 <a href="http://c.biancheng.net/view/6797.html">Java Lambda表达式遍历迭代器</a></dd><dd>11.12 <a href="http://c.biancheng.net/view/6798.html">Java foreach遍历Collection集合</a></dd><dd>11.13 <a href="http://c.biancheng.net/view/6802.html">Predicate操作Collection集合</a></dd><dd>11.14 <a href="http://c.biancheng.net/view/6805.html">Stream操作Collection集合</a></dd><dd>11.15 <a href="http://c.biancheng.net/view/6894.html">Java 9新增的不可变集合</a></dd><dd class="active">11.16 <a href="http://c.biancheng.net/view/vip_7079.html">Java 9中增强的“菱形”语法</a><span class="glyphicon glyphicon-usd"></span></dd><dd>11.17 <a href="http://c.biancheng.net/view/1085.html">Java泛型</a></dd><dd>11.18 <a href="http://c.biancheng.net/view/1094.html">Java图书信息查询</a></dd><dd>11.19 <a href="http://c.biancheng.net/view/1100.html">Java枚举</a></dd><dd>11.20 <a href="http://c.biancheng.net/view/6854.html">Java一对多关系示例</a></dd><dd>11.21 <a href="http://c.biancheng.net/view/6867.html">Java多对多关系示例</a></dd><dd>11.22 <a href="http://c.biancheng.net/view/vip_7080.html">【Java项目实战】模仿斗地主洗牌发牌小游戏（附带源码和解析）</a><span class="glyphicon glyphicon-usd"></span></dd></dl>
			<dd>
				<span class="channel-num">12</span>
				<a href="http://c.biancheng.net/java/120/">Java反射机制</a>
			</dd>
		
			<dd>
				<span class="channel-num">13</span>
				<a href="http://c.biancheng.net/java/130/">Java输入/输出流</a>
			</dd>
		
			<dd>
				<span class="channel-num">14</span>
				<a href="http://c.biancheng.net/java/java/135/">Java注解</a>
			</dd>
		
	</div>
</div>
	<div id="article-wrap">
		<div id="article">
			<div class="arc-info">
	<span class="position"><span class="glyphicon glyphicon-map-marker"></span> <a href="http://c.biancheng.net/">首页</a> &gt; <a href="http://c.biancheng.net/java/">Java教程</a> &gt; <a href="http://c.biancheng.net/java/110/">Java集合、泛型和枚举</a></span>
	<span class="read-num">阅读：3,320</span>
</div>

<div id="ad-position-bottom"></div>
			<h1>Java 9中增强的“菱形”语法</h1>
			<div class="pre-next-page clearfix">
                    <span class="pre left"><span class="icon">&lt;</span> <span class="text-brief text-brief-pre">上一页</span><a href="http://c.biancheng.net/view/6894.html">Java 9新增的不可变集合</a></span>
                    <span class="next right"><a href="http://c.biancheng.net/view/1085.html">Java泛型</a><span class="text-brief text-brief-next">下一页</span> <span class="icon">&gt;</span></span>
                </div>
			<div id="ad-arc-top"><p class="pic"></p><p class="text" adid="java-1v1q2a"><a href="http://c.biancheng.net/view/7552.html" target="_blank" style="color: #D33428;">C语言中文网推出辅导班啦，包括<span style="color: #008000;">「C语言辅导班、C++辅导班、算法/数据结构辅导班」</span>，全部都是一对一教学：一对一辅导 + 一对一答疑 + 布置作业 + 项目实践 + 永久学习。QQ在线，随时响应！</a></p></div>
			<div id="arc-body">在 Java 7 版本以前，如果使用带泛型的接口、类定义变量，那么调用构造器创建对象时构造器的后面也必须带泛型，这显得有些多余了。例如如下两条语句：<br>
<pre class="info-box">List&lt;String&gt; strList = new ArrayList&lt;String&gt;();
Map&lt;String, Integer&gt; scores = new HashMap&lt;String, Integer&gt;();</pre>
上面两条语句中等号右边的尖括号部分完全是多余的，Java 7 版本以前是必需的，不能省略。从 Java 7 开始，Java 允许在构造器后不带完整的泛型信息，只要给出一对尖括号<code>&lt;&gt;</code>即可。Java 可以推断出尖括号里应该是什么泛型信息。<br>
<br>
即上面两条语句可以改写为如下形式：
<pre class="info-box">List&lt;String&gt; strList = new ArrayList&lt;&gt;();
Map&lt;String, Integer&gt; scores = new HashMap&lt;&gt;();</pre>
把两个尖括号并排放在一起非常像一个菱形，这种语法也就被称为<span style="color:#008000;">“菱形”语法</span>。下面程序示范了 Java 7 的菱形语法。<br>
<div class="snippet-container" style="undefined;"><div class="sh_bright snippet-wrap"><div class="snippet-menu sh_sourceCode" style="display: none;"><pre><a class="snippet-copy sh_url" href="http://c.biancheng.net/view/vip_7079.html#" style="display: none;">复制</a><a class="snippet-text sh_url" href="http://c.biancheng.net/view/vip_7079.html#">纯文本</a><a class="snippet-window sh_url" href="http://c.biancheng.net/view/vip_7079.html#">复制</a></pre></div><pre class="java sh_java snippet-formatted sh_sourceCode"><ol class="snippet-num"><li><span class="sh_keyword">public</span> <span class="sh_keyword">class</span><span class="sh_normal"> </span><span class="sh_classname">Test</span> <span class="sh_cbracket">{</span></li><li>    <span class="sh_keyword">public</span> <span class="sh_keyword">static</span> <span class="sh_type">void</span> <span class="sh_function">main</span><span class="sh_symbol">(</span>String<span class="sh_symbol">[]</span> args<span class="sh_symbol">)</span> <span class="sh_cbracket">{</span></li><li>        <span class="sh_comment">// Java自动推断出ArrayList的&lt;&gt;里应该是String</span></li><li>        <span class="sh_usertype">List&lt;String&gt;</span><span class="sh_normal"> </span>names <span class="sh_symbol">=</span> <span class="sh_keyword">new</span> ArrayList<span class="sh_symbol">&lt;&gt;();</span></li><li>        names<span class="sh_symbol">.</span><span class="sh_function">add</span><span class="sh_symbol">(</span><span class="sh_string">"C语言中文网Java入门教程"</span><span class="sh_symbol">);</span></li><li>        names<span class="sh_symbol">.</span><span class="sh_function">add</span><span class="sh_symbol">(</span><span class="sh_string">"C语言中文网Spring入门教程"</span><span class="sh_symbol">);</span></li><li>        <span class="sh_comment">// 遍历names集合，集合元素就是String类型</span></li><li>        names<span class="sh_symbol">.</span><span class="sh_function">forEach</span><span class="sh_symbol">(</span>ele <span class="sh_symbol">-&gt;</span> System<span class="sh_symbol">.</span>out<span class="sh_symbol">.</span><span class="sh_function">println</span><span class="sh_symbol">(</span>ele<span class="sh_symbol">.</span><span class="sh_function">length</span><span class="sh_symbol">()));</span></li><li>        <span class="sh_comment">// Java 自动推断出 HashMap 的&lt;&gt;里应该是 String,List&lt;String&gt;</span></li><li>        <span class="sh_usertype">Map&lt;String, List&lt;String&gt;&gt;</span><span class="sh_normal"> </span>coursesInfo <span class="sh_symbol">=</span> <span class="sh_keyword">new</span> HashMap<span class="sh_symbol">&lt;&gt;();</span></li><li>        <span class="sh_comment">// Java自动推断出ArrayList的&lt;&gt;里应该是String</span></li><li>        <span class="sh_usertype">List&lt;String&gt;</span><span class="sh_normal"> </span>courses <span class="sh_symbol">=</span> <span class="sh_keyword">new</span> ArrayList<span class="sh_symbol">&lt;&gt;();</span></li><li>        courses<span class="sh_symbol">.</span><span class="sh_function">add</span><span class="sh_symbol">(</span><span class="sh_string">"Java入门教程"</span><span class="sh_symbol">);</span></li><li>        courses<span class="sh_symbol">.</span><span class="sh_function">add</span><span class="sh_symbol">(</span><span class="sh_string">"Python基础教程"</span><span class="sh_symbol">);</span></li><li>        coursesInfo<span class="sh_symbol">.</span><span class="sh_function">put</span><span class="sh_symbol">(</span><span class="sh_string">"C语言中文网"</span><span class="sh_symbol">,</span> courses<span class="sh_symbol">);</span></li><li>        <span class="sh_comment">// 遍历 Map 时，Map 的 key 是 String 类型，value List&lt;String&gt;类型</span></li><li>        coursesInfo<span class="sh_symbol">.</span><span class="sh_function">forEach</span><span class="sh_symbol">((</span>key<span class="sh_symbol">,</span> value<span class="sh_symbol">)</span> <span class="sh_symbol">-&gt;</span> System<span class="sh_symbol">.</span>out<span class="sh_symbol">.</span><span class="sh_function">println</span><span class="sh_symbol">(</span>key <span class="sh_symbol">+</span> <span class="sh_string">"--&gt;"</span> <span class="sh_symbol">+</span> value<span class="sh_symbol">));</span></li><li>    <span class="sh_cbracket">}</span></li><li><span class="sh_cbracket">}</span></li></ol></pre><pre class="snippet-textonly sh_sourceCode" style="display:none;">public class Test {
    public static void main(String[] args) {
        // Java自动推断出ArrayList的&lt;&gt;里应该是String
        List&lt;String&gt; names = new ArrayList&lt;&gt;();
        names.add("C语言中文网Java入门教程");
        names.add("C语言中文网Spring入门教程");
        // 遍历names集合，集合元素就是String类型
        names.forEach(ele -&gt; System.out.println(ele.length()));
        // Java 自动推断出 HashMap 的&lt;&gt;里应该是 String,List&lt;String&gt;
        Map&lt;String, List&lt;String&gt;&gt; coursesInfo = new HashMap&lt;&gt;();
        // Java自动推断出ArrayList的&lt;&gt;里应该是String
        List&lt;String&gt; courses = new ArrayList&lt;&gt;();
        courses.add("Java入门教程");
        courses.add("Python基础教程");
        coursesInfo.put("C语言中文网", courses);
        // 遍历 Map 时，Map 的 key 是 String 类型，value List&lt;String&gt;类型
        coursesInfo.forEach((key, value) -&gt; System.out.println(key + "--&gt;" + value));
    }
}</pre></div></div>
上面程序中代码第 4、10 和 12 行代码就是“菱形”语法的示例。从该程序不难看出，“菱形”语法对原有的泛型并没有改变，只是更好地简化了泛型编程。<br>
<br>
Java 9 再次增强了“菱形”语法，它甚至允许在创建匿名内部类时使用菱形语法，Java 可根据上下文来推断匿名内部类中泛型的类型。下面程序示范了在匿名内部类中使用菱形语法。
<div class="snippet-container" style="undefined;"><div class="sh_bright snippet-wrap"><div class="snippet-menu sh_sourceCode" style="display:none;"><pre><a class="snippet-copy sh_url" href="http://c.biancheng.net/view/vip_7079.html#" style="display: none;">复制</a><a class="snippet-text sh_url" href="http://c.biancheng.net/view/vip_7079.html#">纯文本</a><a class="snippet-window sh_url" href="http://c.biancheng.net/view/vip_7079.html#">复制</a></pre></div><pre class="java sh_java snippet-formatted sh_sourceCode"><ol class="snippet-num"><li><span class="sh_keyword">interface</span><span class="sh_normal"> </span><span class="sh_classname">Foo</span><span class="sh_symbol">&lt;</span>T<span class="sh_symbol">&gt;</span> <span class="sh_cbracket">{</span></li><li>    <span class="sh_type">void</span> <span class="sh_function">test</span><span class="sh_symbol">(</span><span class="sh_usertype">T</span><span class="sh_normal"> </span>t<span class="sh_symbol">);</span></li><li><span class="sh_cbracket">}</span></li><li><span style="display:none;">&nbsp;</span></li><li><span class="sh_keyword">public</span> <span class="sh_keyword">class</span><span class="sh_normal"> </span><span class="sh_classname">AnnoymousTest</span> <span class="sh_cbracket">{</span></li><li>    <span class="sh_keyword">public</span> <span class="sh_keyword">static</span> <span class="sh_type">void</span> <span class="sh_function">main</span><span class="sh_symbol">(</span>String<span class="sh_symbol">[]</span> args<span class="sh_symbol">)</span> <span class="sh_cbracket">{</span></li><li>        <span class="sh_comment">// 指定Foo类中泛型为String</span></li><li>        <span class="sh_usertype">Foo&lt;String&gt;</span><span class="sh_normal"> </span>f <span class="sh_symbol">=</span> <span class="sh_keyword">new</span> Foo<span class="sh_symbol">&lt;&gt;()</span> <span class="sh_cbracket">{</span></li><li>            <span class="sh_comment">// test()方法的参数类型为String</span></li><li>            <span class="sh_keyword">public</span> <span class="sh_type">void</span> <span class="sh_function">test</span><span class="sh_symbol">(</span><span class="sh_usertype">String</span><span class="sh_normal"> </span>t<span class="sh_symbol">)</span> <span class="sh_cbracket">{</span></li><li>                System<span class="sh_symbol">.</span>out<span class="sh_symbol">.</span><span class="sh_function">println</span><span class="sh_symbol">(</span><span class="sh_string">"test 方法的 t 参数为："</span> <span class="sh_symbol">+</span> t<span class="sh_symbol">);</span></li><li>            <span class="sh_cbracket">}</span></li><li>        <span class="sh_cbracket">}</span><span class="sh_symbol">;</span></li><li>        <span class="sh_comment">// 使用泛型通配符，此时相当于通配符的上限为Object</span></li><li>        <span class="sh_usertype">Foo&lt;?&gt;</span><span class="sh_normal"> </span>fo <span class="sh_symbol">=</span> <span class="sh_keyword">new</span> Foo<span class="sh_symbol">&lt;&gt;()</span> <span class="sh_cbracket">{</span></li><li>            <span class="sh_comment">// test()方法的参数类型为Object</span></li><li>            <span class="sh_keyword">public</span> <span class="sh_type">void</span> <span class="sh_function">test</span><span class="sh_symbol">(</span><span class="sh_usertype">Object</span><span class="sh_normal"> </span>t<span class="sh_symbol">)</span> <span class="sh_cbracket">{</span></li><li>                System<span class="sh_symbol">.</span>out<span class="sh_symbol">.</span><span class="sh_function">println</span><span class="sh_symbol">(</span><span class="sh_string">"test 方法的 Object 参数为："</span> <span class="sh_symbol">+</span> t<span class="sh_symbol">);</span></li><li>            <span class="sh_cbracket">}</span></li><li>        <span class="sh_cbracket">}</span><span class="sh_symbol">;</span></li><li>        <span class="sh_comment">// 使用泛型通配符，通配符的上限为Number</span></li><li>        <span class="sh_usertype">Foo&lt;? extends Number&gt;</span><span class="sh_normal"> </span>fn <span class="sh_symbol">=</span> <span class="sh_keyword">new</span> Foo<span class="sh_symbol">&lt;&gt;()</span> <span class="sh_cbracket">{</span></li><li>            <span class="sh_comment">// 此时test ()方法的参数类型为Number</span></li><li>            <span class="sh_keyword">public</span> <span class="sh_type">void</span> <span class="sh_function">test</span><span class="sh_symbol">(</span><span class="sh_usertype">Number</span><span class="sh_normal"> </span>t<span class="sh_symbol">)</span> <span class="sh_cbracket">{</span></li><li>                System<span class="sh_symbol">.</span>out<span class="sh_symbol">.</span><span class="sh_function">println</span><span class="sh_symbol">(</span><span class="sh_string">"test 方法的 Number 参数为："</span> <span class="sh_symbol">+</span> t<span class="sh_symbol">);</span></li><li>            <span class="sh_cbracket">}</span></li><li>        <span class="sh_cbracket">}</span><span class="sh_symbol">;</span></li><li>    <span class="sh_cbracket">}</span></li><li><span class="sh_cbracket">}</span></li></ol></pre><pre class="snippet-textonly sh_sourceCode" style="display:none;">interface Foo&lt;T&gt; {
    void test(T t);
}

public class AnnoymousTest {
    public static void main(String[] args) {
        // 指定Foo类中泛型为String
        Foo&lt;String&gt; f = new Foo&lt;&gt;() {
            // test()方法的参数类型为String
            public void test(String t) {
                System.out.println("test 方法的 t 参数为：" + t);
            }
        };
        // 使用泛型通配符，此时相当于通配符的上限为Object
        Foo&lt;?&gt; fo = new Foo&lt;&gt;() {
            // test()方法的参数类型为Object
            public void test(Object t) {
                System.out.println("test 方法的 Object 参数为：" + t);
            }
        };
        // 使用泛型通配符，通配符的上限为Number
        Foo&lt;? extends Number&gt; fn = new Foo&lt;&gt;() {
            // 此时test ()方法的参数类型为Number
            public void test(Number t) {
                System.out.println("test 方法的 Number 参数为：" + t);
            }
        };
    }
}</pre></div></div>
上面程序先定义了一个带泛型声明的接口，接下来第 8、15 和 22 行代码分别示范了在匿名内部类中使用菱形语法。第 8 行代码声明变量时明确地将泛型指定为 String 类型，因此在该匿名内部类中 T 类型就代表了 String 类型；第 15 行代码声明变量时使用通配符来代表泛型（相当于通配符的上限为 Object），因此系统只能推断出 T 代表 Object，所以在该匿名内部类中 T 类型就代表了 Object 类型；第 22 行代码声明变量时使用了带上限（上限是 Number）的通配符，因此系统可以推断出 T 代表 Number 类。<br>
<br>
无论以上哪种方式，Java 9 都允许在使用匿名内部类时使用菱形语法。</div>
			<div id="arc-append">
	<p>关注微信公众号「站长严长生」，在手机上阅读所有教程，随时随地都能学习。本公众号由<a class="col-link" href="http://c.biancheng.net/view/8092.html" target="_blank" rel="nofollow">C语言中文网站长</a>运营，每日更新，坚持原创，敢说真话，凡事有态度。</p>
	<p style="margin-top:12px; text-align:center;">
		<img width="180" src="./11.16Java 9中增强的“菱形”语法_files/qrcode_weixueyuan_original.png" alt="魏雪原二维码"><br>
		<span class="col-green">微信扫描二维码关注公众号</span>
	</p>
</div>
<!-- <p>关注微信公众号「魏雪原」，跟着<a class="col-link" href="/view/8092.html" target="_blank">站长</a>一起学习，拒绝躺平，跳出内卷，用知识完成阶级跃升：</p>
	<ul>
		<li>每日更新，坚持原创，敢说真话，凡事有态度。</li>
		<li>编程+求职+创业+营销，既有硬知识，也有软技能。</li>
		<li>手机端阅读教程，随时随地都能学习。</li>
		<li>即将绑定网站部分功能，包括注册登录、找回密码、获取下载链接等。</li>
	</ul> -->
			<div class="pre-next-page clearfix">
                    <span class="pre left"><span class="icon">&lt;</span> <span class="text-brief text-brief-pre">上一页</span><a href="http://c.biancheng.net/view/6894.html">Java 9新增的不可变集合</a></span>
                    <span class="next right"><a href="http://c.biancheng.net/view/1085.html">Java泛型</a><span class="text-brief text-brief-next">下一页</span> <span class="icon">&gt;</span></span>
                </div>
			<div id="ad-arc-bottom"></div>

<!-- <div id="ad-bottom-weixin" class="clearfix">
	<div class="left" style="width: 535px;">
		<p><span class="col-red">编程帮</span>，一个分享编程知识的公众号。跟着<a class="col-link" href="/cpp/about/author/" target="_blank">站长</a>一起学习，每天都有进步。</p>
		<p>通俗易懂，深入浅出，一篇文章只讲一个知识点。</p>
		<p>文章不深奥，不需要钻研，在公交、在地铁、在厕所都可以阅读，随时随地涨姿势。</p>
		<p>文章不涉及代码，不烧脑细胞，人人都可以学习。</p>
		<p>当你决定关注「编程帮」，你已然超越了90%的程序员！</p>
	</div>
	<div class="right" style="width: 150px;">
		<img width="150" src="/templets/new/images/erweima_biancheng.gif?v=1.6.72" alt="编程帮二维码" /><br />
		<span class="col-green">微信扫描二维码关注</span>
	</div>
</div> -->

<div id="nice-arcs" class="box-bottom">
	<h4>优秀文章</h4>
	<ul class="clearfix">
<li><a href="http://c.biancheng.net/view/1.html" title="Go语言简介">Go语言简介</a></li>
<li><a href="http://c.biancheng.net/view/2191.html" title="如何编译和运行C++程序？">如何编译和运行C++程序？</a></li>
<li><a href="http://c.biancheng.net/view/4563.html" title="Go语言二进制文件的读写操作">Go语言二进制文件的读写操作</a></li>
<li><a href="http://c.biancheng.net/view/4867.html" title="JSP Out对象的其他println方法">JSP Out对象的其他println方法</a></li>
<li><a href="http://c.biancheng.net/view/5216.html" title="Hibernate cache.provider_class属性：设置二级缓存实现类的全名">Hibernate cache.provider_class属性：设置二级缓存实现类的全名</a></li>
<li><a href="http://c.biancheng.net/view/7398.html" title="PHP mb_substr()：截取中文字符串">PHP mb_substr()：截取中文字符串</a></li>
<li><a href="http://c.biancheng.net/view/7459.html" title="HTML表格（table标签）">HTML表格（table标签）</a></li>
<li><a href="http://c.biancheng.net/view/8065.html" title="MySQL MyISAM存储引擎">MySQL MyISAM存储引擎</a></li>
<li><a href="http://c.biancheng.net/view/8638.html" title="C++11多线程编程详解">C++11多线程编程详解</a></li>
<li><a href="http://c.biancheng.net/view/9446.html" title="我的大学为何挂科严重，甚至差点被劝退">我的大学为何挂科严重，甚至差点被劝退</a></li>
</ul>
</div>
		</div>
		
	</div>
</div>
<script type="text/javascript">
// 当前文章ID
window.arcIdRaw = 'a_' + 7079;
window.arcId = "9495gMZaNOe6LobNWU1yEhLB6up6emp0ZCKfK4F++icruSeu82GLWoaw8Kk";
window.typeidChain = "103|79";
</script>
<div id="footer" class="clearfix">
	<div class="info left">
	<p>精美而实用的网站，分享优质编程教程，帮助有志青年。千锤百炼，只为大作；精益求精，处处斟酌；这种教程，看一眼就倾心。</p>
	<p>
		<a href="http://c.biancheng.net/view/8066.html" target="_blank" rel="nofollow">关于网站</a> <span>|</span>
		<a href="http://c.biancheng.net/view/8092.html" target="_blank" rel="nofollow">关于站长</a> <span>|</span>
		<a href="http://c.biancheng.net/view/8097.html" target="_blank" rel="nofollow">如何完成一部教程</a> <span>|</span>
		<a href="http://c.biancheng.net/view/8093.html" target="_blank" rel="nofollow">联系我们</a> <span>|</span>
		<a href="http://c.biancheng.net/sitemap/" target="_blank" rel="nofollow">网站地图</a>
	</p>
	<p>Copyright ©2012-2021 biancheng.net, <a href="http://www.beian.miit.gov.cn/" target="_blank" rel="nofollow" style="color:#666;">陕ICP备15000209号</a></p>
	</div>
	<img class="right" src="./11.16Java 9中增强的“菱形”语法_files/logo_bottom.gif" alt="底部Logo">
	<span id="return-top"><b>↑</b></span>
</div>

<script type="text/javascript">
window.siteId = 4;
window.cmsTemplets = "/templets/new";
window.cmsTempletsVer = "1.6.72";
</script>

<script src="./11.16Java 9中增强的“菱形”语法_files/jquery1.12.4.min.js.下载"></script>
<script src="./11.16Java 9中增强的“菱形”语法_files/common.js.下载"></script>
<span style="display:none;"><script src="./11.16Java 9中增强的“菱形”语法_files/z_stat.php" type="text/javascript" defer="defer" async="async"></script></span>

</body></html>